try:
    t = open("test.txt", "r", encoding="utf-8")
    print(t.read())
finally:
    if t is not None:
        t.close()

# 等价于java中的try-with
with open("test.txt", "r", encoding="utf-8") as f:
    print(f.read())
